home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / dev / c / libiconv_src.lha / autoconf / ltconfig < prev    next >
Encoding:
Text File  |  2000-11-07  |  42.5 KB  |  1,533 lines

  1. #! /bin/sh
  2.  
  3. # ltconfig - Create a system-specific libtool.
  4. # Copyright (C) 1996-1998 Free Software Foundation, Inc.
  5. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  6. #
  7. # This file is free software; you can redistribute it and/or modify it
  8. # under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. # General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. #
  21. # As a special exception to the GNU General Public License, if you
  22. # distribute this file as part of a program that contains a
  23. # configuration script generated by Autoconf, you may include it under
  24. # the same distribution terms that you use for the rest of that program.
  25.  
  26. # A lot of this script is taken from autoconf-2.10.
  27.  
  28. # The HP-UX ksh and POSIX shell print the target directory to stdout
  29. # if CDPATH is set.
  30. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  31.  
  32. echo=echo
  33. if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  34. else
  35.   # The Solaris and AIX default echo program unquotes backslashes.
  36.   # This makes it impossible to quote backslashes using
  37.   #   echo "$something" | sed 's/\\/\\\\/g'
  38.   # So, we emulate echo with printf '%s\n'
  39.   echo="printf %s\\n"
  40.   if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  41.   else
  42.     # Oops.  We have no working printf.  Try to find a not-so-buggy echo.
  43.     echo=echo
  44.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  45.     for dir in $PATH /usr/ucb; do
  46.       if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
  47.         echo="$dir/echo"
  48.         break
  49.       fi
  50.     done
  51.     IFS="$save_ifs"
  52.   fi
  53. fi
  54.  
  55. # Sed substitution that helps us do robust quoting.  It backslashifies
  56. # metacharacters that are still active within double-quoted strings.
  57. Xsed='sed -e s/^X//'
  58. sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  59.  
  60. # Same as above, but do not quote variable references.
  61. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  62.  
  63. # The name of this program.
  64. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  65.  
  66. # Constants:
  67. PROGRAM=ltconfig
  68. PACKAGE=libtool
  69. VERSION=1.2
  70. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  71. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  72. rm="rm -f"
  73.  
  74. help="Try \`$progname --help' for more information."
  75.  
  76. # Global variables:
  77. can_build_shared=yes
  78. enable_shared=yes
  79. # All known linkers require a `.a' archive for static linking.
  80. enable_static=yes
  81. ltmain=
  82. silent=
  83. srcdir=
  84. ac_config_guess=
  85. ac_config_sub=
  86. host=
  87. nonopt=
  88. verify_host=yes
  89. with_gcc=no
  90. with_gnu_ld=no
  91.  
  92. old_AR="$AR"
  93. old_CC="$CC"
  94. old_CFLAGS="$CFLAGS"
  95. old_CPPFLAGS="$CPPFLAGS"
  96. old_LD="$LD"
  97. old_LN_S="$LN_S"
  98. old_NM="$NM"
  99. old_RANLIB="$RANLIB"
  100.  
  101. # Parse the command line options.
  102. args=
  103. prev=
  104. for option
  105. do
  106.   case "$option" in
  107.   -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  108.   *) optarg= ;;
  109.   esac
  110.  
  111.   # If the previous option needs an argument, assign it.
  112.   if test -n "$prev"; then
  113.     eval "$prev=\$option"
  114.     prev=
  115.     continue
  116.   fi
  117.  
  118.   case "$option" in
  119.   --help) cat <<EOM
  120. Usage: $progname [OPTION]... LTMAIN [HOST]
  121.  
  122. Generate a system-specific libtool script.
  123.  
  124.     --disable-shared       do not build shared libraries
  125.     --disable-static       do not build static libraries
  126.     --help                 display this help and exit
  127.     --no-verify            do not verify that HOST is a valid host type
  128.     --quiet                same as \`--silent'
  129.     --silent               do not print informational messages
  130.     --srcdir=DIR           find \`config.guess' in DIR
  131.     --version              output version information and exit
  132.     --with-gcc             assume that the GNU C compiler will be used
  133.     --with-gnu-ld          assume that the C compiler uses the GNU linker
  134.  
  135. LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
  136. functionality.
  137.  
  138. HOST is the canonical host system name [default=guessed].
  139. EOM
  140.   exit 0
  141.   ;;
  142.  
  143.   --disable-shared) enable_shared=no ;;
  144.  
  145.   --disable-static) enable_static=no ;;
  146.  
  147.   --quiet | --silent) silent=yes ;;
  148.  
  149.   --srcdir) prev=srcdir ;;
  150.   --srcdir=*) srcdir="$optarg" ;;
  151.  
  152.   --no-verify) verify_host=no ;;
  153.  
  154.   --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
  155.  
  156.   --with-gcc) with_gcc=yes ;;
  157.   --with-gnu-ld) with_gnu_ld=yes ;;
  158.  
  159.   -*)
  160.     echo "$progname: unrecognized option \`$option'" 1>&2
  161.     echo "$help" 1>&2
  162.     exit 1
  163.     ;;
  164.  
  165.   *)
  166.     if test -z "$ltmain"; then
  167.       ltmain="$option"
  168.     elif test -z "$host"; then
  169. # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  170. #      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  171. #        echo "$progname: warning \`$option' is not a valid host type" 1>&2
  172. #      fi
  173.       host="$option"
  174.     else
  175.       echo "$progname: too many arguments" 1>&2
  176.       echo "$help" 1>&2
  177.       exit 1
  178.     fi ;;
  179.   esac
  180. done
  181.  
  182. if test -z "$ltmain"; then
  183.   echo "$progname: you must specify a LTMAIN file" 1>&2
  184.   echo "$help" 1>&2
  185.   exit 1
  186. fi
  187.  
  188. if test -f "$ltmain"; then :
  189. else
  190.   echo "$progname: \`$ltmain' does not exist" 1>&2
  191.   echo "$help" 1>&2
  192.   exit 1
  193. fi
  194.  
  195. # Quote any args containing shell metacharacters.
  196. ltconfig_args=
  197. for arg
  198. do
  199.   case "$arg" in
  200.   *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  201.   ltconfig_args="$ltconfig_args '$arg'" ;;
  202.   *) ltconfig_args="$ltconfig_args $arg" ;;
  203.   esac
  204. done
  205.  
  206. # A relevant subset of AC_INIT.
  207.  
  208. # File descriptor usage:
  209. # 0 standard input
  210. # 1 file creation
  211. # 2 errors and warnings
  212. # 3 some systems may open it to /dev/tty
  213. # 4 used on the Kubota Titan
  214. # 5 compiler messages saved in config.log
  215. # 6 checking for... messages and results
  216. if test "$silent" = yes; then
  217.   exec 6>/dev/null
  218. else
  219.   exec 6>&1
  220. fi
  221. exec 5>>./config.log
  222.  
  223. # NLS nuisances.
  224. # Only set LANG and LC_ALL to C if already set.
  225. # These must not be set unconditionally because not all systems understand
  226. # e.g. LANG=C (notably SCO).
  227. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  228. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  229.  
  230. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  231.   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  232.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  233.     ac_n= ac_c='
  234. ' ac_t='    '
  235.   else
  236.     ac_n=-n ac_c= ac_t=
  237.   fi
  238. else
  239.   ac_n= ac_c='\c' ac_t=
  240. fi
  241.  
  242. if test -z "$srcdir"; then
  243.   # Assume the source directory is the same one as the path to ltmain.sh.
  244.   srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  245.   test "$srcdir" = "$ltmain" && srcdir=.
  246. fi
  247.  
  248. trap "$rm conftest*; exit 1" 1 2 15
  249. if test "$verify_host" = yes; then
  250.   # Check for config.guess and config.sub.
  251.   ac_aux_dir=
  252.   for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  253.     if test -f $ac_dir/config.guess; then
  254.       ac_aux_dir=$ac_dir
  255.       break
  256.     fi
  257.   done
  258.   if test -z "$ac_aux_dir"; then
  259.     echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
  260.     echo "$help" 1>&2
  261.     exit 1
  262.   fi
  263.   ac_config_guess=$ac_aux_dir/config.guess
  264.   ac_config_sub=$ac_aux_dir/config.sub
  265.  
  266.   # Make sure we can run config.sub.
  267.   if $ac_config_sub sun4 >/dev/null 2>&1; then :
  268.   else
  269.     echo "$progname: cannot run $ac_config_sub" 1>&2
  270.     echo "$help" 1>&2
  271.     exit 1
  272.   fi
  273.  
  274.   echo $ac_n "checking host system type""... $ac_c" 1>&6
  275.  
  276.   host_alias=$host
  277.   case "$host_alias" in
  278.   "")
  279.     if host_alias=`$ac_config_guess`; then :
  280.     else
  281.       echo "$progname: cannot guess host type; you must specify one" 1>&2
  282.       echo "$help" 1>&2
  283.       exit 1
  284.     fi ;;
  285.   esac
  286.   host=`$ac_config_sub $host_alias`
  287.   echo "$ac_t$host" 1>&6
  288.  
  289.   # Make sure the host verified.
  290.   test -z "$host" && exit 1
  291.  
  292. elif test -z "$host"; then
  293.   echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  294.   echo "$help" 1>&2
  295.   exit 1
  296. else
  297.   host_alias=$host
  298. fi
  299.  
  300. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  301. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  302. case "$host_os" in
  303. linux-gnu*) ;;
  304. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  305. esac
  306.  
  307. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  308. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  309. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  310.  
  311. case "$host_os" in
  312. aix3*)
  313.   # AIX sometimes has problems with the GCC collect2 program.  For some
  314.   # reason, if we set the COLLECT_NAMES environment variable, the problems
  315.   # vanish in a puff of smoke.
  316.   if test "${COLLECT_NAMES+set}" != set; then
  317.     COLLECT_NAMES=
  318.     export COLLECT_NAMES
  319.   fi
  320.   ;;
  321. esac
  322.  
  323. # Determine commands to create old-style static archives.
  324. old_archive_cmds='$AR cru $oldlib$oldobjs'
  325. old_postinstall_cmds='chmod 644 $oldlib'
  326. old_postuninstall_cmds=
  327.  
  328. # Set a sane default for `AR'.
  329. test -z "$AR" && AR=ar
  330.  
  331. # If RANLIB is not set, then run the test.
  332. if test "${RANLIB+set}" != "set"; then
  333.   result=no
  334.  
  335.   echo $ac_n "checking for ranlib... $ac_c" 1>&6
  336.   IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  337.   for dir in $PATH; do
  338.     test -z "$dir" && dir=.
  339.     if test -f $dir/ranlib; then
  340.       RANLIB="ranlib"
  341.       result="ranlib"
  342.       break
  343.     fi
  344.   done
  345.   IFS="$save_ifs"
  346.  
  347.   echo "$ac_t$result" 1>&6
  348. fi
  349.  
  350. if test -n "$RANLIB"; then
  351.   old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
  352.   old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
  353. fi
  354.  
  355. # Check to see if we are using GCC.
  356. if test "$with_gcc" != yes || test -z "$CC"; then
  357.   # If CC is not set, then try to find GCC or a usable CC.
  358.   if test -z "$CC"; then
  359.     echo $ac_n "checking for gcc... $ac_c" 1>&6
  360.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  361.     for dir in $PATH; do
  362.       IFS="$save_ifs"
  363.       test -z "$dir" && dir=.
  364.       if test -f $dir/gcc; then
  365.     CC="gcc"
  366.     break
  367.       fi
  368.     done
  369.     IFS="$save_ifs"
  370.  
  371.     if test -n "$CC"; then
  372.       echo "$ac_t$CC" 1>&6
  373.     else
  374.       echo "$ac_t"no 1>&6
  375.     fi
  376.   fi
  377.  
  378.   # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  379.   if test -z "$CC"; then
  380.     echo $ac_n "checking for cc... $ac_c" 1>&6
  381.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  382.     cc_rejected=no
  383.     for dir in $PATH; do
  384.       test -z "$dir" && dir=.
  385.       if test -f $dir/cc; then
  386.     if test "$dir/cc" = "/usr/ucb/cc"; then
  387.       cc_rejected=yes
  388.       continue
  389.     fi
  390.     CC="cc"
  391.     break
  392.       fi
  393.     done
  394.     IFS="$save_ifs"
  395.     if test $cc_rejected = yes; then
  396.       # We found a bogon in the path, so make sure we never use it.
  397.       set dummy $CC
  398.       shift
  399.       if test $# -gt 0; then
  400.     # We chose a different compiler from the bogus one.
  401.     # However, it has the same name, so the bogon will be chosen
  402.     # first if we set CC to just the name; use the full file name.
  403.     shift
  404.     set dummy "$dir/cc" "$@"
  405.     shift
  406.     CC="$@"
  407.       fi
  408.     fi
  409.  
  410.     if test -n "$CC"; then
  411.       echo "$ac_t$CC" 1>&6
  412.     else
  413.       echo "$ac_t"no 1>&6
  414.     fi
  415.  
  416.     if test -z "$CC"; then
  417.       echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
  418.       exit 1
  419.     fi
  420.   fi
  421.  
  422.   # Now see if the compiler is really GCC.
  423.   with_gcc=no
  424.   echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  425.   echo "$progname:425: checking whether we are using GNU C" >&5
  426.  
  427.   $rm conftest.c
  428.   cat > conftest.c <<EOF
  429. #ifdef __GNUC__
  430.   yes;
  431. #endif
  432. EOF
  433.   if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  434.     with_gcc=yes
  435.   fi
  436.   $rm conftest.c
  437.   echo "$ac_t$with_gcc" 1>&6
  438. fi
  439.  
  440. # Allow CC to be a program name with arguments.
  441. set dummy $CC
  442. compiler="$2"
  443.  
  444. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  445. pic_flag=
  446. special_shlib_compile_flags=
  447. wl=
  448. link_static_flag=
  449. no_builtin_flag=
  450.  
  451. if test "$with_gcc" = yes; then
  452.   wl='-Wl,'
  453.   link_static_flag='-static'
  454.   no_builtin_flag=' -fno-builtin'
  455.  
  456.   case "$host_os" in
  457.   aix3* | aix4* | beos* | irix5* | irix6* | osf3* | osf4*)
  458.     # PIC is the default for these OSes.
  459.     ;;
  460.   os2*)
  461.     # We can build DLLs from non-PIC.
  462.     ;;
  463.   amigaos*)
  464.     # FIXME: we need at least 68020 code to build shared libraries, but
  465.     # adding the `-m68020' flag to GCC prevents building anything better,
  466.     # like `-m68040'.
  467.     pic_flag='-m68020 -resident32 -malways-restore-a4'
  468.     ;;
  469.   *)
  470.     pic_flag='-fPIC'
  471.     ;;
  472.   esac
  473. else
  474.   # PORTME Check for PIC flags for the system compiler.
  475.   case "$host_os" in
  476.   aix3* | aix4*)
  477.     # All AIX code is PIC.
  478.     link_static_flag='-bnso -bI:/lib/syscalls.exp'
  479.     ;;
  480.  
  481.   hpux9* | hpux10*)
  482.     # Is there a better link_static_flag that works with the bundled CC?
  483.     wl='-Wl,'
  484.     link_static_flag="${wl}-a ${wl}archive"
  485.     pic_flag='+Z'
  486.     ;;
  487.  
  488.   irix5* | irix6*)
  489.     wl='-Wl,'
  490.     link_static_flag='-non_shared'
  491.     # PIC (with -KPIC) is the default.
  492.     ;;
  493.  
  494.   os2*)
  495.     # We can build DLLs from non-PIC.
  496.     ;;
  497.  
  498.   osf3* | osf4*)
  499.     # All OSF/1 code is PIC.
  500.     wl='-Wl,'
  501.     link_static_flag='-non_shared'
  502.     ;;
  503.  
  504.   sco3.2v5*)
  505.     pic_flag='-Kpic'
  506.     link_static_flag='-dn'
  507.     special_shlib_compile_flags='-belf'
  508.     ;;
  509.  
  510.   solaris2*)
  511.     pic_flag='-KPIC'
  512.     link_static_flag='-Bstatic'
  513.     wl='-Wl,'
  514.     ;;
  515.  
  516.   sunos4*)
  517.     pic_flag='-PIC'
  518.     link_static_flag='-Bstatic'
  519.     wl='-Qoption ld '
  520.     ;;
  521.  
  522.   sysv4.2uw2*)
  523.     pic_flag='-KPIC'
  524.     link_static_flag='-Bstatic'
  525.     wl='-Wl,'
  526.     ;;
  527.  
  528.   uts4*)
  529.     pic_flag='-pic'
  530.     link_static_flag='-Bstatic'
  531.     ;;
  532.  
  533.   *)
  534.     can_build_shared=no
  535.     ;;
  536.   esac
  537. fi
  538.  
  539. if test -n "$pic_flag"; then
  540.   echo "$ac_t$pic_flag" 1>&6
  541.  
  542.   # Check to make sure the pic_flag actually works.
  543.   echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  544.   $rm conftest*
  545.   echo 'int x;' > conftest.c
  546.   save_CFLAGS="$CFLAGS"
  547.   CFLAGS="$CFLAGS $pic_flag -DPIC"
  548.   echo "$progname:548: checking if $compiler PIC flag $pic_flag works" >&5
  549.   if { (eval echo $progname:549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  550.     # Append any warnings to the config.log.
  551.     cat conftest.err 1>&5
  552.  
  553.     # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  554.     # create non-PIC objects.  So, if there were any warnings, we assume that
  555.     # PIC is not supported.
  556.     if test -s conftest.err; then
  557.       echo "$ac_t"no 1>&6
  558.       can_build_shared=no
  559.       pic_flag=
  560.     else
  561.       echo "$ac_t"yes 1>&6
  562.       pic_flag=" $pic_flag"
  563.     fi
  564.   else
  565.     # Append any errors to the config.log.
  566.     cat conftest.err 1>&5
  567.     can_build_shared=no
  568.     pic_flag=
  569.     echo "$ac_t"no 1>&6
  570.   fi
  571.   CFLAGS="$save_CFLAGS"
  572.   $rm conftest*
  573. else
  574.   echo "$ac_t"none 1>&6
  575. fi
  576.  
  577. # Check for any special shared library compilation flags.
  578. if test -n "$special_shlib_compile_flags"; then
  579.   echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  580.   if echo "$old_CC $old_CFLAGS " | egrep -e "[     ]$special_shlib_compile_flags[     ]" >/dev/null; then :
  581.   else
  582.     echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  583.     can_build_shared=no
  584.   fi
  585. fi
  586.  
  587. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  588. $rm conftest*
  589. echo 'main(){return(0);}' > conftest.c
  590. save_LDFLAGS="$LDFLAGS"
  591. LDFLAGS="$LDFLAGS $link_static_flag"
  592. echo "$progname:592: checking if $compiler static flag $link_static_flag works" >&5
  593. if { (eval echo $progname:593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  594.   echo "$ac_t$link_static_flag" 1>&6
  595. else
  596.   echo "$ac_t"none 1>&6
  597.   link_static_flag=
  598. fi
  599. LDFLAGS="$save_LDFLAGS"
  600. $rm conftest*
  601.  
  602. if test -z "$LN_S"; then
  603.   # Check to see if we can use ln -s, or we need hard links.
  604.   echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  605.   $rm conftestdata
  606.   if ln -s X conftestdata 2>/dev/null; then
  607.     $rm conftestdata
  608.     LN_S="ln -s"
  609.   else
  610.     LN_S=ln
  611.   fi
  612.   if test "$LN_S" = "ln -s"; then
  613.     echo "$ac_t"yes 1>&6
  614.   else
  615.     echo "$ac_t"no 1>&6
  616.   fi
  617. fi
  618.  
  619. # Make sure LD is an absolute path.
  620. if test -z "$LD"; then
  621.   ac_prog=ld
  622.   if test "$with_gcc" = yes; then
  623.     # Check if gcc -print-prog-name=ld gives a path.
  624.     echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  625.     echo "$progname:625: checking for ld used by GCC" >&5
  626.     ac_prog=`($CC -print-prog-name=ld) 2>&5`
  627.     case "$ac_prog" in
  628.     # Accept absolute paths.
  629.     /* | [A-Za-z]:\\*)
  630.       test -z "$LD" && LD="$ac_prog"
  631.       ;;
  632.     "")
  633.       # If it fails, then pretend we are not using GCC.
  634.       ac_prog=ld
  635.       ;;
  636.     *)
  637.       # If it is relative, then search for the first ld in PATH.
  638.       with_gnu_ld=unknown
  639.       ;;
  640.     esac
  641.   elif test "$with_gnu_ld" = yes; then
  642.     echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  643.     echo "$progname:643: checking for GNU ld" >&5
  644.   else
  645.     echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  646.     echo "$progname:646: checking for non-GNU ld" >&5
  647.   fi
  648.  
  649.   if test -z "$LD"; then
  650.     IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  651.     for ac_dir in $PATH; do
  652.       test -z "$ac_dir" && ac_dir=.
  653.       if test -f "$ac_dir/$ac_prog"; then
  654.     LD="$ac_dir/$ac_prog"
  655.     # Check to see if the program is GNU ld.  I'd rather use --version,
  656.     # but apparently some GNU ld's only accept -v.
  657.     # Break only if it was the GNU/non-GNU ld that we prefer.
  658.     if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  659.       test "$with_gnu_ld" != no && break
  660.     else
  661.       test "$with_gnu_ld" != yes && break
  662.     fi
  663.       fi
  664.     done
  665.     IFS="$ac_save_ifs"
  666.   fi
  667.  
  668.   if test -n "$LD"; then
  669.     echo "$ac_t$LD" 1>&6
  670.   else
  671.     echo "$ac_t"no 1>&6
  672.   fi
  673.  
  674.   if test -z "$LD"; then
  675.     echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  676.     exit 1
  677.   fi
  678. fi
  679.  
  680. # Check to see if it really is or is not GNU ld.
  681. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  682. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  683. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  684.   with_gnu_ld=yes
  685. else
  686.   with_gnu_ld=no
  687. fi
  688. echo "$ac_t$with_gnu_ld" 1>&6
  689.  
  690. # See if the linker supports building shared libraries.
  691. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  692.  
  693. allow_undefined_flag=
  694. no_undefined_flag=
  695. archive_cmds=
  696. old_archive_from_new_cmds=
  697. export_dynamic_flag_spec=
  698. hardcode_libdir_flag_spec=
  699. hardcode_libdir_separator=
  700. hardcode_direct=no
  701. hardcode_minus_L=no
  702. hardcode_shlibpath_var=unsupported
  703. runpath_var=
  704.  
  705. case "$host_os" in
  706. amigaos* | beos* | sunos4*)
  707.   # On these operating systems, we should treat GNU ld like the system ld.
  708.   gnu_ld_acts_native=yes
  709.   ;;
  710. *)
  711.   gnu_ld_acts_native=no
  712.   ;;
  713. esac
  714.  
  715. ld_shlibs=yes
  716. if test "$with_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
  717.  
  718.   # See if GNU ld supports shared libraries.
  719.   if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  720.     archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
  721.     runpath_var=LD_RUN_PATH
  722.     ld_shlibs=yes
  723.   else
  724.     ld_shlibs=no
  725.   fi
  726.  
  727.   if test "$ld_shlibs" = yes; then
  728.     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  729.     export_dynamic_flag_spec='${wl}--export-dynamic'
  730.   fi
  731. else
  732.   # PORTME fill in a description of your system's linker (not GNU ld)
  733.   case "$host_os" in
  734.   aix3*)
  735.     allow_undefined_flag=unsupported
  736.     archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
  737.     # Note: this linker hardcodes the directories in LIBPATH if there
  738.     # are no directories specified by -L.
  739.     hardcode_minus_L=yes
  740.     if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  741.       # Neither direct hardcoding nor static linking is supported with a
  742.       # broken collect2.
  743.       hardcode_direct=unsupported
  744.     fi
  745.     ;;
  746.  
  747.   aix4*)
  748.     allow_undefined_flag=unsupported
  749.     archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
  750.     hardcode_direct=yes
  751.     hardcode_minus_L=yes
  752.     ;;
  753.  
  754.   amigaos*)
  755.     archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
  756.     hardcode_libdir_flag_spec='-L$libdir'
  757.     hardcode_minus_L=yes
  758.     ;;
  759.  
  760.   beos*)
  761.     archive_cmds='$CC -nostart ${wl}-soname ${wl}$soname -o $lib $libobjs'
  762.     runpath_var=LD_RUN_PATH
  763.     ;;
  764.  
  765.   freebsd1*)
  766.     ld_shlibs=no
  767.     can_build_shared=no
  768.     ;;
  769.  
  770.   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  771.   # support.  Future versions do this automatically, but an explicit c++rt0.o
  772.   # does not break anything, and helps significantly (at the cost of a little
  773.   # extra space).
  774.   freebsd2.2*)
  775.     archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
  776.     hardcode_libdir_flag_spec='-R$libdir'
  777.     hardcode_direct=yes
  778.     hardcode_minus_L=yes
  779.     hardcode_shlibpath_var=no
  780.     ;;
  781.  
  782.   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  783.   freebsd2*)
  784.     archive_cmds='$LD -Bshareable -o $lib$libobjs'
  785.     hardcode_direct=yes
  786.     hardcode_minus_L=yes
  787.     hardcode_shlibpath_var=no
  788.     ;;
  789.  
  790.   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  791.   freebsd*)
  792.     archive_cmds='$CC -shared -o $lib$libobjs'
  793.     hardcode_libdir_flag_spec='-R$libdir'
  794.     hardcode_direct=yes
  795.     hardcode_minus_L=yes
  796.     hardcode_shlibpath_var=no
  797.     ;;
  798.  
  799.   hpux9*)
  800.     archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
  801.     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  802.     hardcode_direct=yes
  803.     hardcode_minus_L=yes
  804.     export_dynamic_flag_spec='${wl}-E'
  805.     ;;
  806.  
  807.   hpux10*)
  808.     archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
  809.     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  810.     hardcode_direct=yes
  811.     hardcode_minus_L=yes
  812.     export_dynamic_flag_spec='${wl}-E'
  813.     ;;
  814.  
  815.   irix5* | irix6*)
  816.     archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
  817.     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  818.     ;;
  819.  
  820.   netbsd*)
  821.     # Tested with NetBSD 1.2 ld
  822.     archive_cmds='$LD -Bshareable -o $lib$libobjs'
  823.     hardcode_libdir_flag_spec='-R$libdir'
  824.     hardcode_direct=yes
  825.     hardcode_shlibpath_var=no
  826.     ;;
  827.  
  828.   openbsd*)
  829.     archive_cmds='$LD -Bshareable -o $lib$libobjs'
  830.     hardcode_libdir_flag_spec='-R$libdir'
  831.     hardcode_direct=yes
  832.     hardcode_shlibpath_var=no
  833.     ;;
  834.  
  835.   os2*)
  836.     hardcode_libdir_flag_spec='-L$libdir'
  837.     hardcode_minus_L=yes
  838.     allow_undefined_flag=unsupported
  839.     archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def;$echo DATA >> $objdir/$libname.def;$echo " SINGLE NONSHARED" >> $objdir/$libname.def;$echo EXPORTS >> $objdir/$libname.def;emxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def'
  840.     old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  841.     ;;
  842.  
  843.   osf3* | osf4*)
  844.     allow_undefined_flag=' -expect_unresolved \*'
  845.     archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  846.     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  847.     hardcode_libdir_separator=:
  848.     ;;
  849.  
  850.   sco3.2v5*)
  851.     archive_cmds='$LD -G -o $lib$libobjs'
  852.     hardcode_direct=yes
  853.     ;;
  854.  
  855.   solaris2*)
  856.     no_undefined_flag=' -z text'
  857.     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
  858.     hardcode_libdir_flag_spec='-R$libdir'
  859.     hardcode_shlibpath_var=no
  860.  
  861.     # Solaris 2 before 2.5 hardcodes -L paths.
  862.     case "$host_os" in
  863.     solaris2.[0-4]*)
  864.       hardcode_minus_L=yes
  865.       ;;
  866.     esac
  867.     ;;
  868.  
  869.   sunos4*)
  870.     if test "$with_gcc" = yes; then
  871.       archive_cmds='$CC -shared -o $lib$libobjs'
  872.     else
  873.       archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
  874.     fi
  875.  
  876.     if test "$with_gnu_ld" = yes; then
  877.       export_dynamic_flag_spec='${wl}-export-dynamic'
  878.     fi
  879.     hardcode_libdir_flag_spec='-L$libdir'
  880.     hardcode_direct=yes
  881.     hardcode_minus_L=yes
  882.     hardcode_shlibpath_var=no
  883.     ;;
  884.  
  885.   uts4*)
  886.     archive_cmds='$LD -G -h $soname -o $lib$libobjs'
  887.     hardcode_libdir_flag_spec='-L$libdir'
  888.     hardcode_direct=no
  889.     hardcode_minus_L=no
  890.     hardcode_shlibpath_var=no
  891.     ;;
  892.  
  893.   *)
  894.     ld_shlibs=no
  895.     can_build_shared=no
  896.     ;;
  897.   esac
  898. fi
  899. echo "$ac_t$ld_shlibs" 1>&6
  900.  
  901. if test -z "$NM"; then
  902.   echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  903.   case "$NM" in
  904.   /* | [A-Za-z]:\\*) ;; # Let the user override the test with a path.
  905.   *)
  906.     IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  907.     for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
  908.       test -z "$ac_dir" && ac_dir=.
  909.       if test -f $ac_dir/nm; then
  910.         # Check to see if the nm accepts a BSD-compat flag.
  911.         # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  912.         #   nm: unknown option "B" ignored
  913.         if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  914.           NM="$ac_dir/nm -B"
  915.         elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  916.           NM="$ac_dir/nm -p"
  917.     else
  918.           NM="$ac_dir/nm"
  919.     fi
  920.         break
  921.       fi
  922.     done
  923.     IFS="$ac_save_ifs"
  924.     test -z "$NM" && NM=nm
  925.     ;;
  926.   esac
  927.   echo "$ac_t$NM" 1>&6
  928. fi
  929.  
  930. # Check for command to grab the raw symbol name followed by C symbol from nm.
  931. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  932.  
  933. # These are sane defaults that work on at least a few old systems.
  934. # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
  935.  
  936. # Character class describing NM global symbol codes.
  937. symcode='[BCDEGRSTU]'
  938.  
  939. # Regexp to match symbols that can be accessed directly from C.
  940. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  941.  
  942. # Transform the above into a raw symbol and a C symbol.
  943. symxfrm='\1 \1'
  944.  
  945. # Define system-specific variables.
  946. case "$host_os" in
  947. aix*)
  948.   symcode='[BCDTU]'
  949.   ;;
  950. irix*)
  951.   # Cannot use undefined symbols on IRIX because inlined functions mess us up.
  952.   symcode='[BCDEGRST]'
  953.   ;;
  954. solaris2*)
  955.   symcode='[BDTU]'
  956.   ;;
  957. esac
  958.  
  959. # If we're using GNU nm, then use its standard symbol codes.
  960. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  961.   symcode='[ABCDGISTUW]'
  962. fi
  963.  
  964. # Write the raw and C identifiers.
  965. global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
  966.  
  967. # Check to see that the pipe works correctly.
  968. pipe_works=no
  969. $rm conftest*
  970. cat > conftest.c <<EOF
  971. #ifdef __cplusplus
  972. extern "C" {
  973. #endif
  974. char nm_test_var;
  975. void nm_test_func(){}
  976. #ifdef __cplusplus
  977. }
  978. #endif
  979. main(){nm_test_var='a';nm_test_func();return(0);}
  980. EOF
  981.  
  982. echo "$progname:977: checking if global_symbol_pipe works" >&5
  983. if { (eval echo $progname:978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
  984.   # Now try to grab the symbols.
  985.   nlist=conftest.nm
  986.   if { echo "$progname:981: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  987.  
  988.     # Try sorting and uniquifying the output.
  989.     if sort "$nlist" | uniq > "$nlist"T; then
  990.       mv -f "$nlist"T "$nlist"
  991.       wcout=`wc "$nlist" 2>/dev/null`
  992.       count=`$echo "X$wcout" | $Xsed -e 's/^[     ]*\([0-9][0-9]*\).*$/\1/'`
  993.       (test "$count" -ge 0) 2>/dev/null || count=-1
  994.     else
  995.       rm -f "$nlist"T
  996.       count=-1
  997.     fi
  998.  
  999.     # Make sure that we snagged all the symbols we need.
  1000.     if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  1001.       if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  1002.     cat <<EOF > conftest.c
  1003. #ifdef __cplusplus
  1004. extern "C" {
  1005. #endif
  1006.  
  1007. EOF
  1008.         # Now generate the symbol file.
  1009.         sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  1010.  
  1011.     cat <<EOF >> conftest.c
  1012. #if defined (__STDC__) && __STDC__
  1013. # define __ptr_t void *
  1014. #else
  1015. # define __ptr_t char *
  1016. #endif
  1017.  
  1018. /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  1019. int dld_preloaded_symbol_count = $count;
  1020.  
  1021. /* The mapping between symbol names and symbols. */
  1022. struct {
  1023.   char *name;
  1024.   __ptr_t address;
  1025. }
  1026. dld_preloaded_symbols[] =
  1027. {
  1028. EOF
  1029.         sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
  1030.         cat <<\EOF >> conftest.c
  1031.   {0, (__ptr_t) 0}
  1032. };
  1033.  
  1034. #ifdef __cplusplus
  1035. }
  1036. #endif
  1037. EOF
  1038.         # Now try linking the two files.
  1039.         mv conftest.o conftestm.o
  1040.     save_LIBS="$LIBS"
  1041.     save_CFLAGS="$CFLAGS"
  1042.         LIBS='conftestm.o'
  1043.     CFLAGS="$CFLAGS$no_builtin_flag"
  1044.         if { (eval echo $progname:1039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  1045.           pipe_works=yes
  1046.         else
  1047.           echo "$progname: failed program was:" >&5
  1048.           cat conftest.c >&5
  1049.         fi
  1050.         LIBS="$save_LIBS"
  1051.       else
  1052.         echo "cannot find nm_test_func in $nlist" >&5
  1053.       fi
  1054.     else
  1055.       echo "cannot find nm_test_var in $nlist" >&5
  1056.     fi
  1057.   else
  1058.     echo "cannot run $global_symbol_pipe" >&5
  1059.   fi
  1060. else
  1061.   echo "$progname: failed program was:" >&5
  1062.   cat conftest.c >&5
  1063. fi
  1064. $rm conftest*
  1065.  
  1066. # Do not use the global_symbol_pipe unless it works.
  1067. echo "$ac_t$pipe_works" 1>&6
  1068. test "$pipe_works" = yes || global_symbol_pipe=
  1069.  
  1070. # Check hardcoding attributes.
  1071. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  1072. hardcode_action=
  1073. if test -n "$hardcode_libdir_flag_spec" || \
  1074.    test -n "$runpath_var"; then
  1075.  
  1076.   # We can hardcode non-existant directories.
  1077.   if test "$hardcode_direct" != no && \
  1078.      test "$hardcode_minus_L" != no && \
  1079.      test "$hardcode_shlibpath_var" != no; then
  1080.  
  1081.     # Linking always hardcodes the temporary library directory.
  1082.     hardcode_action=relink
  1083.   else
  1084.     # We can link without hardcoding, and we can hardcode nonexisting dirs.
  1085.     hardcode_action=immediate
  1086.   fi
  1087. elif test "$hardcode_direct" != yes && \
  1088.      test "$hardcode_minus_L" != yes && \
  1089.      test "$hardcode_shlibpath_var" != yes; then
  1090.   # We cannot hardcode anything.
  1091.   hardcode_action=unsupported
  1092. else
  1093.   # We can only hardcode existing directories.
  1094.   hardcode_action=relink
  1095. fi
  1096. echo "$ac_t$hardcode_action" 1>&6
  1097. test "$hardcode_action" = unsupported && can_build_shared=no
  1098.  
  1099.  
  1100. reload_flag=
  1101. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  1102. echo $ac_n "checking for $LD option to produce relocatable object files... $ac_c" 1>&6
  1103. # PORTME Some linker may need a different reload flag.
  1104. reload_flag='-r'
  1105. echo "$ac_t$reload_flag"
  1106. test -n "$reload_flag" && reload_flag=" $reload_flag"
  1107.  
  1108. # PORTME Fill in your ld.so characteristics
  1109. library_names_spec=
  1110. libname_spec='lib$name'
  1111. soname_spec=
  1112. postinstall_cmds=
  1113. postuninstall_cmds=
  1114. finish_cmds=
  1115. finish_eval=
  1116. shlibpath_var=
  1117. version_type=none
  1118. dynamic_linker="$host_os ld.so"
  1119.  
  1120. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  1121. case "$host_os" in
  1122. aix3* | aix4*)
  1123.   version_type=linux
  1124.   library_names_spec='${libname}${release}.so.$versuffix $libname.a'
  1125.   shlibpath_var=LIBPATH
  1126.  
  1127.   # AIX has no versioning support, so we append a major version to the name.
  1128.   soname_spec='${libname}${release}.so.$major'
  1129.   ;;
  1130.  
  1131. amigaos*)
  1132.   library_names_spec='$libname.ixlibrary $libname.a'
  1133.   # Create ${libname}_ixlibrary.a entries in /sys/libs.
  1134.   finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  1135.   ;;
  1136.  
  1137. beos*)
  1138.   library_names_spec='${libname}.so'
  1139.   shlibpath_var=LIBRARY_PATH
  1140.   ;;
  1141.  
  1142. freebsd1*)
  1143.   dynamic_linker=no
  1144.   ;;
  1145.  
  1146. freebsd*)
  1147.   version_type=sunos
  1148.   library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1149.   finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  1150.   shlibpath_var=LD_LIBRARY_PATH
  1151.   ;;
  1152.  
  1153. gnu*)
  1154.   version_type=sunos
  1155.   library_names_spec='${libname}${release}.so.$versuffix'
  1156.   shlibpath_var=LD_LIBRARY_PATH
  1157.   ;;
  1158.  
  1159. hpux9* | hpux10*)
  1160.   # Give a soname corresponding to the major version so that dld.sl refuses to
  1161.   # link against other versions.
  1162.   dynamic_linker="$host_os dld.sl"
  1163.   version_type=sunos
  1164.   shlibpath_var=SHLIB_PATH
  1165.   library_names_spec='${libname}${release}.sl.$versuffix ${libname}${release}.sl.$major $libname.sl'
  1166.   soname_spec='${libname}${release}.sl.$major'
  1167.   # HP-UX runs *really* slowly unless shared libraries are mode 555.
  1168.   postinstall_cmds='chmod 555 $lib'
  1169.   ;;
  1170.  
  1171. irix5* | irix6*)
  1172.   version_type=osf
  1173.   soname_spec='${libname}${release}.so'
  1174.   library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1175.   shlibpath_var=LD_LIBRARY_PATH
  1176.   ;;
  1177.  
  1178. # No shared lib support for Linux oldld, aout, or coff.
  1179. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  1180.   dynamic_linker=no
  1181.   ;;
  1182.  
  1183. # This must be Linux ELF.
  1184. linux-gnu*)
  1185.   version_type=linux
  1186.   library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1187.   soname_spec='${libname}${release}.so.$major'
  1188.   finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
  1189.   shlibpath_var=LD_LIBRARY_PATH
  1190.  
  1191.   if test -f /lib/ld.so.1; then
  1192.     dynamic_linker='GNU ld.so'
  1193.   else
  1194.     # Only the GNU ld.so supports shared libraries on MkLinux.
  1195.     case "$host_cpu" in
  1196.     powerpc*) dynamic_linker=no ;;
  1197.     *) dynamic_linker='Linux ld.so' ;;
  1198.     esac
  1199.   fi
  1200.   ;;
  1201.  
  1202. netbsd* | openbsd*)
  1203.   version_type=sunos
  1204.   library_names_spec='${libname}${release}.so.$versuffix'
  1205.   finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  1206.   shlibpath_var=LD_LIBRARY_PATH
  1207.   ;;
  1208.  
  1209. os2*)
  1210.   libname_spec='$name'
  1211.   library_names_spec='$libname.dll $libname.a'
  1212.   dynamic_linker='OS/2 ld.exe'
  1213.   shlibpath_var=LIBPATH
  1214.   ;;
  1215.  
  1216. osf3* | osf4*)
  1217.   version_type=osf
  1218.   soname_spec='${libname}${release}.so'
  1219.   library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1220.   shlibpath_var=LD_LIBRARY_PATH
  1221.   ;;
  1222.  
  1223. sco3.2v5*)
  1224.   version_type=osf
  1225.   soname_spec='${libname}${release}.so.$major'
  1226.   library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1227.   shlibpath_var=LD_LIBRARY_PATH
  1228.   ;;
  1229.  
  1230. solaris2*)
  1231.   version_type=linux
  1232.   library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1233.   soname_spec='${libname}${release}.so.$major'
  1234.   shlibpath_var=LD_LIBRARY_PATH
  1235.   ;;
  1236.  
  1237. sunos4*)
  1238.   version_type=sunos
  1239.   library_names_spec='${libname}${release}.so.$versuffix'
  1240.   finish_cmds='PATH="$PATH:/usr/etc" ldconfig $libdir'
  1241.   shlibpath_var=LD_LIBRARY_PATH
  1242.   ;;
  1243.  
  1244. sysv4.2uw2*)
  1245.   version_type=linux
  1246.   library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1247.   soname_spec='${libname}${release}.so.$major'
  1248.   shlibpath_var=LD_LIBRARY_PATH
  1249.   ;;
  1250.  
  1251. uts4*)
  1252.   version_type=linux
  1253.   library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1254.   soname_spec='${libname}${release}.so.$major'
  1255.   shlibpath_var=LD_LIBRARY_PATH
  1256.   ;;
  1257.  
  1258. *)
  1259.   dynamic_linker=no
  1260.   ;;
  1261. esac
  1262. echo "$ac_t$dynamic_linker"
  1263. test "$dynamic_linker" = no && can_build_shared=no
  1264.  
  1265. # Report the final consequences.
  1266. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  1267.  
  1268. echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  1269. test "$can_build_shared" = "no" && enable_shared=no
  1270.  
  1271. # On AIX, shared libraries and static libraries use the same namespace, and
  1272. # are all built from PIC.
  1273. case "$host_os" in
  1274. aix*)
  1275.   test "$enable_shared" = yes && enable_static=no
  1276.   if test -n "$RANLIB"; then
  1277.     archive_cmds="$archive_cmds;\$RANLIB \$lib"
  1278.     postinstall_cmds='$RANLIB $lib'
  1279.   fi
  1280.   ;;
  1281. esac
  1282.  
  1283. echo "$ac_t$enable_shared" 1>&6
  1284.  
  1285. # Make sure either enable_shared or enable_static is yes.
  1286. test "$enable_shared" = yes || enable_static=yes
  1287.  
  1288. echo "checking whether to build static libraries... $enable_static" 1>&6
  1289.  
  1290. echo $ac_n "checking for objdir... $ac_c" 1>&6
  1291. rm -f .libs 2>/dev/null
  1292. mkdir .libs 2>/dev/null
  1293. if test -d .libs; then
  1294.   objdir=.libs
  1295. else
  1296.   # MS-DOS does not allow filenames that begin with a dot.
  1297.   objdir=_libs
  1298. fi
  1299. rmdir .libs 2>/dev/null
  1300. echo "$ac_t$objdir" 1>&6
  1301.  
  1302. # Copy echo and quote the copy, instead of the original, because it is
  1303. # used later.
  1304. ltecho="$echo"
  1305.  
  1306. # Now quote all the things that may contain metacharacters.
  1307. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  1308.   old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
  1309.   link_static_flag no_builtin_flag export_dynamic_flag_spec \
  1310.   libname_spec library_names_spec soname_spec RANLIB \
  1311.   old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  1312.   old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
  1313.   allow_undefined_flag no_undefined_flag \
  1314.   finish_cmds finish_eval global_symbol_pipe \
  1315.   hardcode_libdir_flag_spec hardcode_libdir_separator; do
  1316.  
  1317.   case "$var" in
  1318.   reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  1319.   old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
  1320.   postinstall_cmds | postuninstall_cmds | finish_cmds)
  1321.     # Double-quote double-evaled strings.
  1322.     eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
  1323.     ;;
  1324.   *)
  1325.     eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
  1326.     ;;
  1327.   esac
  1328. done
  1329.  
  1330. ofile=libtool
  1331. trap "$rm $ofile; exit 1" 1 2 15
  1332. echo creating $ofile
  1333. $rm $ofile
  1334. cat <<EOF > $ofile
  1335. #! /bin/sh
  1336.  
  1337. # libtool - Provide generalized library-building support services.
  1338. # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
  1339. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  1340. #
  1341. # Copyright (C) 1996-1998 Free Software Foundation, Inc.
  1342. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  1343. #
  1344. # This program is free software; you can redistribute it and/or modify
  1345. # it under the terms of the GNU General Public License as published by
  1346. # the Free Software Foundation; either version 2 of the License, or
  1347. # (at your option) any later version.
  1348. #
  1349. # This program is distributed in the hope that it will be useful, but
  1350. # WITHOUT ANY WARRANTY; without even the implied warranty of
  1351. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1352. # General Public License for more details.
  1353. #
  1354. # You should have received a copy of the GNU General Public License
  1355. # along with this program; if not, write to the Free Software
  1356. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  1357. #
  1358. # As a special exception to the GNU General Public License, if you
  1359. # distribute this file as part of a program that contains a
  1360. # configuration script generated by Autoconf, you may include it under
  1361. # the same distribution terms that you use for the rest of that program.
  1362.  
  1363. # This program was configured as follows,
  1364. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1365. #
  1366. # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
  1367. # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
  1368. #   $0$ltconfig_args
  1369. #
  1370. # Compiler and other test output produced by $progname, useful for
  1371. # debugging $progname, is in ./config.log if it exists.
  1372.  
  1373. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  1374. Xsed="sed -e s/^X//"
  1375.  
  1376. # The HP-UX ksh and POSIX shell print the target directory to stdout
  1377. # if CDPATH is set.
  1378. if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  1379.  
  1380. # An echo program that does not interpret backslashes.
  1381. echo="$ltecho"
  1382.  
  1383. # The version of $progname that generated this script.
  1384. LTCONFIG_VERSION="$VERSION"
  1385.  
  1386. # Shell to use when invoking shell scripts.
  1387. SHELL=${CONFIG_SHELL-/bin/sh}
  1388.  
  1389. # Whether or not to build libtool libraries.
  1390. build_libtool_libs=$enable_shared
  1391.  
  1392. # Whether or not to build old-style libraries.
  1393. build_old_libs=$enable_static
  1394.  
  1395. # The host system.
  1396. host_alias="$host_alias"
  1397. host="$host"
  1398.  
  1399. # The archiver.
  1400. AR="$AR"
  1401.  
  1402. # The default C compiler.
  1403. CC="$CC"
  1404.  
  1405. # The linker used to build libraries.
  1406. LD="$LD"
  1407.  
  1408. # Whether we need hard or soft links.
  1409. LN_S="$LN_S"
  1410.  
  1411. # A BSD-compatible nm program.
  1412. NM="$NM"
  1413.  
  1414. # The name of the directory that contains temporary libtool files.
  1415. objdir="$objdir"
  1416.  
  1417. # How to create relocatable object files.
  1418. reload_flag="$reload_flag"
  1419. reload_cmds="$reload_cmds"
  1420.  
  1421. # How to pass a linker flag through the compiler.
  1422. wl="$wl"
  1423.  
  1424. # Additional compiler flags for building library objects.
  1425. pic_flag="$pic_flag"
  1426.  
  1427. # Compiler flag to prevent dynamic linking.
  1428. link_static_flag="$link_static_flag"
  1429.  
  1430. # Compiler flag to turn off builtin functions.
  1431. no_builtin_flag="$no_builtin_flag"
  1432.  
  1433. # Compiler flag to allow reflexive dlopens.
  1434. export_dynamic_flag_spec="$export_dynamic_flag_spec"
  1435.  
  1436. # Library versioning type.
  1437. version_type=$version_type
  1438.  
  1439. # Format of library name prefix.
  1440. libname_spec="$libname_spec"
  1441.  
  1442. # List of archive names.  First name is the real one, the rest are links.
  1443. # The last name is the one that the linker finds with -lNAME.
  1444. library_names_spec="$library_names_spec"
  1445.  
  1446. # The coded name of the library, if different from the real name.
  1447. soname_spec="$soname_spec"
  1448.  
  1449. # Commands used to build and install an old-style archive.
  1450. RANLIB="$RANLIB"
  1451. old_archive_cmds="$old_archive_cmds"
  1452. old_postinstall_cmds="$old_postinstall_cmds"
  1453. old_postuninstall_cmds="$old_postuninstall_cmds"
  1454.  
  1455. # Create an old-style archive from a shared archive.
  1456. old_archive_from_new_cmds="$old_archive_from_new_cmds"
  1457.  
  1458. # Commands used to build and install a shared archive.
  1459. archive_cmds="$archive_cmds"
  1460. postinstall_cmds="$postinstall_cmds"
  1461. postuninstall_cmds="$postuninstall_cmds"
  1462.  
  1463. # Flag that allows shared libraries with undefined symbols to be built.
  1464. allow_undefined_flag="$allow_undefined_flag"
  1465.  
  1466. # Flag that forces no undefined symbols.
  1467. no_undefined_flag="$no_undefined_flag"
  1468.  
  1469. # Commands used to finish a libtool library installation in a directory.
  1470. finish_cmds="$finish_cmds"
  1471.  
  1472. # Same as above, but a single script fragment to be evaled but not shown.
  1473. finish_eval="$finish_eval"
  1474.  
  1475. # Take the output of nm and produce a listing of raw symbols and C names.
  1476. global_symbol_pipe="$global_symbol_pipe"
  1477.  
  1478. # This is the shared library runtime path variable.
  1479. runpath_var=$runpath_var
  1480.  
  1481. # This is the shared library path variable.
  1482. shlibpath_var=$shlibpath_var
  1483.  
  1484. # How to hardcode a shared library path into an executable.
  1485. hardcode_action=$hardcode_action
  1486.  
  1487. # Flag to hardcode \$libdir into a binary during linking.
  1488. # This must work even if \$libdir does not exist.
  1489. hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
  1490.  
  1491. # Whether we need a single -rpath flag with a separated argument.
  1492. hardcode_libdir_separator="$hardcode_libdir_separator"
  1493.  
  1494. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  1495. # resulting binary.
  1496. hardcode_direct=$hardcode_direct
  1497.  
  1498. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  1499. # resulting binary.
  1500. hardcode_minus_L=$hardcode_minus_L
  1501.  
  1502. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  1503. # the resulting binary.
  1504. hardcode_shlibpath_var=$hardcode_shlibpath_var
  1505.  
  1506. EOF
  1507.  
  1508. case "$host_os" in
  1509. aix3*)
  1510.   cat <<\EOF >> $ofile
  1511. # AIX sometimes has problems with the GCC collect2 program.  For some
  1512. # reason, if we set the COLLECT_NAMES environment variable, the problems
  1513. # vanish in a puff of smoke.
  1514. if test "${COLLECT_NAMES+set}" != set; then
  1515.   COLLECT_NAMES=
  1516.   export COLLECT_NAMES
  1517. fi
  1518.  
  1519. EOF
  1520.   ;;
  1521. esac
  1522.  
  1523. # Append the ltmain.sh script.
  1524. cat "$ltmain" >> $ofile || (rm -f $ofile; exit 1)
  1525.  
  1526. chmod +x $ofile
  1527. exit 0
  1528.  
  1529. # Local Variables:
  1530. # mode:shell-script
  1531. # sh-indentation:2
  1532. # End:
  1533.